$(function () {
    findCompanyNav();
})

function findCompanyNav() {

    let res = myAjax("/companynav", {}, "get");
    console.log(res);
    if (res != null) {
        setCompanyData(res.companyModel);
        setNavModelList(res.navModelList);

    }
}

function setCompanyData(data) {
    // $("#logo").attr("src",data.logo)
    $("#logo").css({"background-image": "url('" + data.logo + "')"});

    $("#phone").html(data.phone);

    $("#net").html("网址:" + data.net);
    $("#email").html("邮箱:" + data.email + "联系电话:" + data.linePhone + "(座机)");
    $("#address").html("联系地址:" + data.address);
    $("#version").html(data.version);

}

function setNavModelList(data) {
    let html = '';
    for (let i = 0; i < data.length; i++) {
        html += ' <div onclick="location.href=\'' + data[i].href + '\'">' + data[i].title + '</div>';
    }
    $("#nav").html(html);
}
